class Bullet{
    //属性
    constructor(option){
        this.dom = createImg()
        this.width = 61
        this.height = 99
        this.top = option.top
        this.left = option.left
        this.speed = option.speed
        this.dir = option.dir
        this.dom.src = option.resource
    }
    
    //移动
    move(){
        this.top += this.dir*this.speed
    }
    //patch
    patch(){
        render(this.dom,this.top,this.left)
    }
    //出上下边界
    isOk(){
        if(this.top + this.height < -50 || this.top > 1100){
            return false
        }
        return true
    }
}

